﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using HardwareInterface;
namespace CameraForm
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            //WebCamera cam = new WebCamera(panel1.Handle, panel1.Width, panel1.Height);
            cam = new WebCamera(pictureBox1.Handle, pictureBox1.Width, pictureBox1.Height);
            
            cam.StartWebCam();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Bitmap bmp = new Bitmap(pictureBox1.Width,pictureBox1.Height);

            cam.GrabImage("d:\\a.bmp");
        }
        WebCamera cam;
    }
}
